﻿namespace LastVersionOfIpPackage
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using LastVersionOfIpPackage.GUI;

    /// <summary>
    /// core form
    /// </summary>
    public partial class IpPackage : Form
    {
        /// <summary>
        /// type of noise need make it
        /// </summary>
       private Enum_needed.NoiseType typeOfNoise = Enum_needed.NoiseType.Uniform;

        /// <summary>
        /// Initializes a new instance of the <see cref="IpPackage"/> class.
        /// </summary>
        public IpPackage()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Handles the Click event of the OpenToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string opendFileName = openFileDialog1.FileName;
                    string opendFileName2 = openFileDialog1.SafeFileName;
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Open(opendFileName);
                    ////set Image information
                    this.lbHieght.Text = this.PicImageOrginal.Height.ToString();
                    this.lbWidth.Text = this.PicImageOrginal.Width.ToString();
                    string[] fileFormat = opendFileName.Split('.');
                    this.lbImageFormat.Text = fileFormat[1] + " file";
                }
                catch
                {
                    MessageBox.Show("open fail. make sure for format of file");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the ExitToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// Handles the Click event of the SaveToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string opendFileName = saveFileDialog1.FileName;
                    string opendFileName2 = saveFileDialog1.FileName;
                    ImageOperations.ImageEnchance.NewImageEnchanemwnt.Save((Bitmap)this.PicImageOrginal.Image, opendFileName);
                }
                catch
                {
                    MessageBox.Show("open fail. make sure for format of file");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the TranslateToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void TranslateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.Translate new_Tran = new GUI.Translate();
            new_Tran.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_Tran.ShowDialog();
            if (new_Tran.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Tran.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the ReSizeToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ReSizeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.ResizeF new_Resize = new GUI.ResizeF();
            new_Resize.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_Resize.ShowDialog();
            if (new_Resize.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Resize.ResultImg;
                this.lbWidth.Text = this.PicImageOrginal.Image.Width.ToString();
                this.lbHieght.Text = this.PicImageOrginal.Image.Height.ToString();
            }
        }

        /// <summary>
        /// Handles the Click event of the RotationToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RotationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.Rotate new_Rotate = new GUI.Rotate();
            new_Rotate.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_Rotate.ShowDialog();
            if (new_Rotate.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Rotate.ResultImg;
                this.lbWidth.Text = this.PicImageOrginal.Image.Width.ToString();
                this.lbHieght.Text = this.PicImageOrginal.Image.Height.ToString();
            }
        }

        /// <summary>
        /// Handles the Click event of the GrayToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GrayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Gray((Bitmap)this.PicImageOrginal.Image);
            }
            catch
            {
                MessageBox.Show("Found error");
            }
        }

        /// <summary>
        /// Handles the Click event of the HistogramToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void HistogramToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.Histogram new_Histo = new GUI.Histogram();
            new_Histo.SetInfo(this.PicImageOrginal.Image);
            new_Histo.Show();
        }

        /// <summary>
        /// Handles the Paint event of the PicImageOrginal control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param>
        private void PicImageOrginal_Paint(object sender, PaintEventArgs e)
        {
            this.GroupBGreen_CheckedChanged(null, null);
            this.GroupBGray_CheckedChanged(null, null);
            this.GroupBBlue_CheckedChanged(null, null);
            this.GroupBRed_CheckedChanged(null, null);
            this.RadioBlueCheck_CheckedChanged(null, null);
            this.RadioGreenCheck_CheckedChanged(null, null);
            this.RadioRedCheck_CheckedChanged(null, null);
        }

        /// <summary>
        /// Handles the CheckedChanged event of the GroupBRed control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GroupBRed_CheckedChanged(object sender, EventArgs e)
        {
            if (this.GroupBRed.Checked == true) 
            {
            try
            {
                this.picbHistograph.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.DrawHistogram(Enum_needed.ColorNeed.Red, (Bitmap)this.PicImageOrginal.Image, 175);
            }
            catch
            {
                MessageBox.Show("error happened");
            }
        }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the GroupBGreen control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GroupBGreen_CheckedChanged(object sender, EventArgs e)
        {
            if (this.GroupBGreen.Checked == true)
            {
            try
            {
                this.picbHistograph.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.DrawHistogram(Enum_needed.ColorNeed.Green, (Bitmap)this.PicImageOrginal.Image, 175);
            }
            catch
            {
                MessageBox.Show("error happened");
            }
        }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the GroupBGray control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GroupBGray_CheckedChanged(object sender, EventArgs e)
        {
            if (this.GroupBGray.Checked == true) 
            {
            try
            {
                this.picbHistograph.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.DrawHistogram(Enum_needed.ColorNeed.Gray, (Bitmap)this.PicImageOrginal.Image, 175);
            }
            catch
            {
                MessageBox.Show("error happened");
            }
        }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the GroupBBlue control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GroupBBlue_CheckedChanged(object sender, EventArgs e)
        {
            if (this.GroupBBlue.Checked == true) 
            {
                try
                {
                    this.picbHistograph.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.DrawHistogram(Enum_needed.ColorNeed.Blue, (Bitmap)this.PicImageOrginal.Image, 175);
                }
                catch
                {
                    MessageBox.Show("error happened");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the BrightnessToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BrightnessToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.ContrastAndBrightness new_brightness = new GUI.ContrastAndBrightness();
            new_brightness.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_brightness.ShowDialog();
            if (new_brightness.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_brightness.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the ThresholdToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ThresholdToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.groupThresholdInfo.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the BtnDoneThreshold control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BtnDoneThreshold_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Threshold((Bitmap)this.PicImageOrginal.Image, int.Parse(this.txtThreSholdValue.Text));
                this.groupThresholdInfo.Visible = false;
            }
            catch
            {
                MessageBox.Show("check your data error happend");
            }
        }

        /// <summary>
        /// Handles the Click event of the EqulizationToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void EqulizationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Equalization((Bitmap)this.PicImageOrginal.Image);
            }
            catch
            {
                MessageBox.Show("operation fail. make sure for your data");
            }
        }

        /// <summary>
        /// Handles the Click event of the GToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.GamaForm new_Gamma = new GUI.GamaForm();
            new_Gamma.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_Gamma.ShowDialog();
            if (new_Gamma.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Gamma.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MatchingToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MatchingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.Matching_form new_match = new GUI.Matching_form();
            new_match.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_match.ShowDialog();
            if (new_match.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_match.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the NegativeToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NegativeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Negative((Bitmap)this.PicImageOrginal.Image);
            }
            catch
            {
                MessageBox.Show("operation fail. make sure for your data");
            }
        }

        /// <summary>
        /// Handles the Click event of the AddOrSubToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void AddOrSubToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.Calculation_form new_caluc = new GUI.Calculation_form();
            new_caluc.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_caluc.ShowDialog();
            if (new_caluc.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_caluc.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the QuantizationToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void QuantizationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.QuantizationForm new_quan = new GUI.QuantizationForm();
            new_quan.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_quan.ShowDialog();
            if (new_quan.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_quan.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MeanFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MeanFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.SmoothingFilter new_Smooth = new GUI.SmoothingFilter();
            new_Smooth.SetInfo(this.PicImageOrginal.Image, Enum_needed.SmoothingType.Mean);
            new_Smooth.ShowDialog();
            if (new_Smooth.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = new_Smooth.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the GaussianFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GaussianFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.SmoothingFilter new_Smooth = new GUI.SmoothingFilter();
            new_Smooth.SetInfo(this.PicImageOrginal.Image, Enum_needed.SmoothingType.Gaussian);
            new_Smooth.ShowDialog();
            if (new_Smooth.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = new_Smooth.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the DLineSharpingLaplacianToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void DLineSharpingLaplacianToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Sharpening((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Point);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the HorizontalToolStripMenuItem1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void HorizontalToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Sharpening((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Horizontal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the VerticalToolStripMenuItem1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void VerticalToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Sharpening((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Vertical);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the RightDiagonalToolStripMenuItem1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RightDiagonalToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Sharpening((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.RightDiagonal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the LeftDiagonalToolStripMenuItem1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void LeftDiagonalToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.Sharpening((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.LeftDiagonal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the LaplacianToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void LaplacianToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.EdgeDetection((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Point);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the HorizontalToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void HorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.EdgeDetection((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Horizontal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the VerticalToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void VerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.EdgeDetection((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.Vertical);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the RightDiagonalToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RightDiagonalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.EdgeDetection((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.RightDiagonal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the LeftDiagonalToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void LeftDiagonalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.EdgeDetection((Bitmap)this.PicImageOrginal.Image, Enum_needed.DetectionAndSharpingType.LeftDiagonal);
            }
            catch
            {
                if (this.PicImageOrginal.Image == null)
                {
                    MessageBox.Show("no image to make edge detection operation");
                }
                else
                {
                    MessageBox.Show("operation fail make sure your data");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the ConnectWithMatlapToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ConnectWithMatlapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.MatLapConnectOperation new_MatlapOper = new GUI.MatLapConnectOperation();
            new_MatlapOper.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_MatlapOper.ShowDialog();
            if (new_MatlapOper.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = new_MatlapOper.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the HPFToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void HPFToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.MATLAPFilters new_MATLAPFilter = new GUI.MATLAPFilters();
            new_MATLAPFilter.SetInfo(Enum_needed.FilterType.HPF, this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_MATLAPFilter.ShowDialog();
            if (new_MATLAPFilter.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_MATLAPFilter.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the LowPassFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void LowPassFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.MATLAPFilters new_MATLAPFilter = new GUI.MATLAPFilters();
            new_MATLAPFilter.SetInfo(Enum_needed.FilterType.LPF, this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            new_MATLAPFilter.ShowDialog();
            if (new_MATLAPFilter.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_MATLAPFilter.ResultImg;
            }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the RadioRedCheck control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RadioRedCheck_CheckedChanged(object sender, EventArgs e)
        {
            if (this.radioRedCheck.Checked == true)
            {
                try
                {
                    Bitmap graphImg = ImageOperations.ImageEnchance.NewImageEnchanemwnt.ConvertToFreq((Bitmap)this.PicImageOrginal.Image, Enum_needed.ColorNeed.Red);
                    this.picMagnitude.Image = graphImg;
                }
                catch
                {
                    MessageBox.Show("error in connection with matlap try in next time");
                }
            }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the RadioGreenCheck control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RadioGreenCheck_CheckedChanged(object sender, EventArgs e)
        {
            if (this.radioGreenCheck.Checked == true)
            {
                try
                {
                    Bitmap graphImg = ImageOperations.ImageEnchance.NewImageEnchanemwnt.ConvertToFreq((Bitmap)this.PicImageOrginal.Image, Enum_needed.ColorNeed.Green);
                    this.picMagnitude.Image = graphImg;
                }
                catch
                {
                    MessageBox.Show("error in connection with matlap try in next time");
                }
            }
        }

        /// <summary>
        /// Handles the CheckedChanged event of the RadioBlueCheck control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RadioBlueCheck_CheckedChanged(object sender, EventArgs e)
        {
            if (this.radioBlueCheck.Checked == true)
            {
                try
                {
                    Bitmap graphImg = ImageOperations.ImageEnchance.NewImageEnchanemwnt.ConvertToFreq((Bitmap)this.PicImageOrginal.Image, Enum_needed.ColorNeed.Blue);
                    this.picMagnitude.Image = graphImg;
                }
                catch
                {
                    MessageBox.Show("error in connection with matlap try in next time");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the SaltAndPepperToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void SaltAndPepperToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.SaltAndPepper;
            this.grpSaltAndPepper.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the UniformToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void UniformToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Uniform;
            this.grpUniform.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the GaussianToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GaussianToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Gaussian;
            this.grpGaussian.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the PeriodicToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void PeriodicToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Periodic;
            this.grpPeriodic.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the BtnAddNoise control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BtnAddNoise_Click(object sender, EventArgs e)
        {
            if (this.typeOfNoise == Enum_needed.NoiseType.SaltAndPepper)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddSaltAndPepperNoise((Bitmap)this.PicImageOrginal.Image, double.Parse(this.txtPs.Text), double.Parse(this.txtPp.Text));
                    this.grpSaltAndPepper.Visible = false;
                    this.BtnAddNoise.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Exponential)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddExponentialNoise((Bitmap)this.PicImageOrginal.Image, double.Parse(this.txtLanda.Text), double.Parse(this.txtPercentageExponential.Text));
                    this.grpExponNoise.Visible = false;
                    this.BtnAddNoise.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Periodic)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddPeriodicNoise((Bitmap)this.PicImageOrginal.Image, float.Parse(this.txtAmplitude.Text), float.Parse(this.txtFrecX.Text), float.Parse(this.txtFrecY.Text), float.Parse(this.txtPX.Text), float.Parse(this.txtPY.Text));
                    this.grpPeriodic.Visible = false;
                    this.BtnAddNoise.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Uniform)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddUniformNoise((Bitmap)this.PicImageOrginal.Image, int.Parse(this.txtA.Text), int.Parse(this.txtB.Text), float.Parse(this.txtPrecentage.Text));
                    this.BtnAddNoise.Visible = false;
                    this.grpUniform.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Gaussian)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddGaussianNoise((Bitmap)this.PicImageOrginal.Image, double.Parse(this.txtMean.Text), double.Parse(this.txtSigma.Text), double.Parse(this.txtPrecentageGaussian.Text));
                    this.BtnAddNoise.Visible = false;
                    this.grpGaussian.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Rayleigh)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddRayleighNoise((Bitmap)this.PicImageOrginal.Image, int.Parse(this.txtA.Text), int.Parse(this.txtB.Text), float.Parse(this.txtPrecentage.Text));
                    this.BtnAddNoise.Visible = false;
                    this.grpUniform.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }

            if (this.typeOfNoise == Enum_needed.NoiseType.Gamma)
            {
                try
                {
                    this.PicImageOrginal.Image = ImageOperations.ImageEnchance.NewImageEnchanemwnt.AddGammaNoise((Bitmap)this.PicImageOrginal.Image, int.Parse(this.txtA.Text), int.Parse(this.txtB.Text), float.Parse(this.txtPrecentage.Text));
                    this.BtnAddNoise.Visible = false;
                    this.grpUniform.Visible = false;
                }
                catch
                {
                    MessageBox.Show("check for data input  and try again");
                }
            }
        }

        /// <summary>
        /// Handles the Click event of the MorphologicalToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MorphologicalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Morphological opreation = new Morphological();
            opreation.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text);
            opreation.ShowDialog();
            if (opreation.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the NotchRejectToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NotchRejectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.RemoveNoiseFreq new_Remove = new GUI.RemoveNoiseFreq();
            new_Remove.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text, Enum_needed.FilterType.NotchReject);
            new_Remove.ShowDialog();
            if (new_Remove.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Remove.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the NotchPassToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NotchPassToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.RemoveNoiseFreq new_Remove = new GUI.RemoveNoiseFreq();
            new_Remove.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text, Enum_needed.FilterType.NotchPass);
            new_Remove.ShowDialog();
            if (new_Remove.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Remove.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the BandRejectToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BandRejectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.RemoveNoiseFreq new_Remove = new GUI.RemoveNoiseFreq();
            new_Remove.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text, Enum_needed.FilterType.BandReject);
            new_Remove.ShowDialog();
            if (new_Remove.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Remove.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the BandPassToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BandPassToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.RemoveNoiseFreq new_Remove = new GUI.RemoveNoiseFreq();
            new_Remove.SetInfo(this.PicImageOrginal.Image, this.lbWidth.Text, this.lbHieght.Text, Enum_needed.FilterType.BandPass);
            new_Remove.ShowDialog();
            if (new_Remove.SaveOrNot1 == true)
            {
                this.PicImageOrginal.Image = new_Remove.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the GeometricMeanFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GeometricMeanFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.Mean);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MaxFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MaxFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.Mean);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MinFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MinFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.Min);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MedianFilterToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MedianFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.Median);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the MidpointToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MidpointToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.Midpoint);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the AdaptiveMedianToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void AdaptiveMedianToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Remove_Noise opreation = new Remove_Noise();
            opreation.SetInfo(this.PicImageOrginal.Image, Enum_needed.OrderStatisticType.AdaptiveMedian);
            opreation.ShowDialog();
            if (opreation.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = opreation.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the matlabFunctiondToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MatlabFunctiondToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MatlapFunctions formm = new MatlapFunctions();
            formm.SetInfo((Bitmap)this.PicImageOrginal.Image);
            formm.ShowDialog();
            if (formm.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = formm.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the RayleighToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void RayleighToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Rayleigh;
            this.grpUniform.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the GammaToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void GammaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Gamma;
            this.grpUniform.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the ExponentialToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ExponentialToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.typeOfNoise = Enum_needed.NoiseType.Exponential;
            this.grpExponNoise.Visible = true;
            this.BtnAddNoise.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the AlphatrimmedMeanToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void AlphatrimmedMeanToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.SmoothingFilter new_Smooth = new GUI.SmoothingFilter();
            new_Smooth.SetInfo(this.PicImageOrginal.Image, Enum_needed.SmoothingType.AlphaTrimmedMean);
            new_Smooth.ShowDialog();
            if (new_Smooth.SaveOrNot == true)
            {
                this.PicImageOrginal.Image = new_Smooth.ResultImg;
            }
        }

        /// <summary>
        /// Handles the Click event of the ClassicToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ClassicToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.DarkGray;
            this.groupThresholdInfo.BackColor = Color.Yellow;
            this.tabPage1.BackColor = Color.LightGray;
            this.tabPage2.BackColor = Color.LightGray;
            this.menuStrip1.BackColor = Color.Orchid;
        }

        /// <summary>
        /// Handles the MouseClick event of the IpPackage control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void IpPackage_MouseClick(object sender, MouseEventArgs e)
        {
            this.menuThemes.Visible = true;
        }

        /// <summary>
        /// Handles the Click event of the BingToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.LavenderBlush;
            this.groupThresholdInfo.BackColor = Color.Pink;
            this.tabPage1.BackColor = Color.Pink;
            this.tabPage2.BackColor = Color.Pink;
            this.menuStrip1.BackColor = Color.HotPink;
        }

        /// <summary>
        /// Handles the Click event of the DefaultToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void DefaultToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.DimGray;
            this.groupThresholdInfo.BackColor = Color.DarkGray;
            this.tabPage1.BackColor = Color.DimGray;
            this.tabPage2.BackColor = Color.DimGray;
            this.menuStrip1.BackColor = Color.DarkGray;
        }
    }
}